The Liar ^^^^^ **Definition:** * Testing asynchronous code becomes tricky as it is based on a future value that you might receive or might not. **Also Known As:** * Evergreen Tests, Success Against All Odds **Code Example:** .. code-block:: ruby test('the data is peanut butter', () => { function callback(data) { expect(data).toBe('peanut butter'); } fetchData(callback); }); **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `Anti-Patterns - Digital Tapestry `_ * `Categorising Test Smells `_ :octicon:`graph;1em` * `Smells in software test code: A survey of knowledge in industry and academia `_ * `TDD anti patterns - Chapter 1 `_ :octicon:`file-code;1em` * `TDD anti-patterns - the liar, excessive setup, the giant, slow poke `_ :octicon:`file-code;1em` * `Test-Driven Development: TDD Anti-Patterns `_ * `Unit Testing Anti-Patterns, Full List `_